// pages/SCM/store/goods/goods.js
const app = getApp()
const util = require('../../../../utils/util.js')
const lbbService = require('../../../service/service.js')

Page({

  /**
   * 页面的初始数据
   */
  data: {
    pageNum:1,
    pageSize:20,
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    let that = this
    that.toast = that.selectComponent("#toast")
    this.personalModal = this.selectComponent("#personalModal")
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.goodsCheckList();
    let that = this
    //
    
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },
        
        
        

        
        
        getMore:function(){
          this.data.pageNum+=1;
          this.goodsCheckList();
        },
        getFirst: function () {
          this.data.pageNum == 1;
          this.goodsCheckList();
        },
        goodsCheckList:function(){
                let that=this;
                let params={};
                params.pageNum=that.data.pageNum;
                params.pageSize = that.data.pageSize;
                lbbService.goodsCheckList(params,function(res){
                        let goodsCheckList=res.data;
                        if(that.data.pageNum>1){
                          goodsCheckList = that.data.goodsCheckList.concat(res.data); 
                        }
                        that.setData({ goodsCheckList: goodsCheckList});
                });

        },

  
})